package com.nova.edc.model.system;

import com.nova.frame.utils.DateUtils;
import com.seio.edc.util.AssitDateUtil;
import com.seio.edc.util.DateTimeUtil;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class ModelConstant {

    /*
     * 通用模块
     */
    public static final int ROLE_SYSTEM = 1; // 用户类型---系统管理员
    public static final int ROLE_COMMON = 3; // 用户类型---普通用户
    public static final int ROLE_GROUP = 4; // 用户类型---集团用户

    public static final int SCRAPPED_DELETE = 1; // 已删除
    public static final int SCRAPPED_UNDELETE = 0; // 未删除

    public static final String DEVICE_LIGHTENERGY = "灯具";
    public static final String DEVICE_AIR = "空调";
    public static final String DEVICE_OTHER = "其他";
    public static final int TRA_LIGHTTYPE = 1; // 传统灯具的类型默认是1
    public static final int LED_LIGHTTYPE = 2; // led灯具的类型默认是2
    public static final int REAL_LIGHTTYPE = 3;//节点真实使用灯具
    public static final int AIR_AIRTYPE = 4; // 空调类型
    public static final String AREA_ONLINE = "设备在线指示";

    public static final int LIGHT_ON = 1; // 灯具点亮
    public static final int LIGHT_OFF = 0; // 灯具熄灭
    public static final String S_LIGHT_ON = "1"; // 灯具点亮
    public static final String S_LIGHT_OFF = "0"; // 灯具熄灭

    public static final String SEPARATOR = ","; // 全局公用分隔符



    /*
     * 登录、菜单栏、首页模块
     */
    public static final String SESSION_LOGINNAME = "loginname"; // 登录用户的用户名
    public static final String SESSION_ROLEID = "roleid"; // 登录用户的用户角色ID

    public static final int MENU_FIRST = 1; // 一级菜单
    public static final int MENU_SECOND = 2; // 二级菜单

    /*
     * 结算管理模块
     */
    public static final int PAY_NOTPAY = 1; // 未交费
    public static final int PAY_PAID = 2; // 已交费
    public static final int PAY_DELAY = 3; // 延期缴费

    /*
     * 社会效益模块
     */
    public static final int SOCIAL_CO2 = 2; // CO2的powercode

    /*
     * 统计模块
     */
    public static final String MIN_DATE = "2014-01-01"; // 最小时间
    public static final String MAX_DATE = "2050-01-01"; // 最大时间

    public static final String MIN_TIME = "15:00:00"; // 通宵供电设定模块，在此区间点灯视为通宵供电
    public static final String MAX_TIME = "23:00:00";

    public static final String MIN_MONTH_DATE = "1950-01"; // 月份最小时间
    public static final String MAX_MONTH_DATE = "2050-01"; // 月份最大时间

    public static final String TRA_POWER = "traPower"; // 传统灯具耗电量
    public static final String LED_POWER = "ledPower"; // LED灯具耗电量
    public static final String SAVE_POWER = "savePower"; // LED灯具耗电量
    public static final String TRA_COST = "traCost"; // 传统灯具耗电金额
    public static final String LED_COST = "ledCost"; // LED灯具耗电金额
    public static final String SAVE_COST = "saveCost"; // 节省电价
    public static final String UNIT_SAVE_POWER = "unitSavePower"; // 平均每分钟耗电量
    public static final String UNIT_SAVE_COST = "unitSaveCost"; // 平均每分钟节省电费

    public static final String INDEX_CAR = "indexCar"; // 相当于汽车的排放量
    public static final String INDEX_CO2 = "indexCo2"; // 相当于CO2的排放量
    public static final Integer SOCAIL_DIVIDE = 1000000; // 获取社会效益的除值
    public static final Double SOCAIL_CAR = 3.246; // 获取社会效益的除值

    public static final String TIME_TASK = "定时任务"; // 定时任务

    public static Map<Integer, String> CUSTOMERINFO_TYPE = new HashMap<Integer, String>();

    static {
        CUSTOMERINFO_TYPE.put(1, "节能型");
        CUSTOMERINFO_TYPE.put(2, "能源型");
    }

    public static final Integer CUSTOMERINFO_TYPE_REDUCTION = 1;
    public static final Integer CUSTOMERINFO_TYPE_POWER = 2;

    public static final Integer GATHER_ERRORTIME = 4; //小于等于4分钟为无效数据

    public static final Integer GATHER_ERRORSTATE = 2; //设备失效状态
    public static final Integer WARNING_TIMES = 3;  //预警线

    public static final String WARNING_MIN_TIME = "05:00:00";
    public static final String WARNING_MAX_TIME = "23:00:00";
    public static final Integer WARNING_TIME_MISSED = 30;

    /*
    * 数据报表
    */
    public static final String MAXIMAL_SIGH = "以上";
    public static final String PERSONEL_SELECT[] = {"1-30", "31-100", "100" + MAXIMAL_SIGH};
    public static final String ACREAGE_SELECT[] = {"1-50", "50-300", "300" + MAXIMAL_SIGH};

    public static final String MENU_DATA = "数据报表";


//    地图

    public static final String MAP_SERACHTIME[] = {
            DateUtils.getMonth(AssitDateUtil.getAddMonth(new Date(), -2)) + "月 " + DateUtils.getDate2Str("YYYY年MM月", AssitDateUtil.getAddMonth(new Date(), -2)),
            "上月  " + DateUtils.getDate2Str("YYYY年MM月", AssitDateUtil.getAddMonth(new Date(), -1)),
            "昨日  " + DateUtils.getDate2Str("YYYY年MM月dd日", DateUtils.getYesterdayDate()),
            "本月  " + DateTimeUtil.getNowTime("YYYY年MM月"),
            "今年  " + DateTimeUtil.getNowTime("YYYY年"),
            "去年  " + DateUtils.getDate2Str("YYYY年", AssitDateUtil.getAddMonth(new Date(), -12)),
            "总计"
    };

    public static final Integer MAP_DEFAULT_TIME_TYPE = 3;


    //    API
    public static final String API_FORMAT_DD = "%d";
    public static final String API_FORMAT_YYYY_MM = "%Y-%m";
    public static final String API_FORMAT_YYYY_MM_DD = "%Y-%m-%d";

    public static final Integer API_CHARTTYPE_COMMON = 0;
    public static final Integer API_CHARTTYPE_TIME = 1;

    public static final Integer API_AREATYPE_PROVINCE = 1;
    public static final Integer API_AREATYPE_CITY = 2;
    public static final Integer API_AREATYPE_DISTRICT = 3;
    public static final Integer API_AREATYPE_STORE = 4;
    public static final Integer API_AREATYPE_AREA = 5;

    public static final String API_AREA_PROVINCE = "Province";
    public static final String API_AREA_CITY = "City";
    public static final String API_AREA_DISTRICT = "District";
    public static final String API_AREA_STORE = "CustomerName";
    public static final String API_AREA_AREA = "AreaName";

    public static final Integer API_ORDERTYPE_POWER = 1;
    public static final Integer API_ORDERTYPE_UNITPERSON = 2;
    public static final Integer API_ORDERTYPE_UNITSQUARE = 3;

    public static final String API_ORDER_POWER = "power";
    public static final String API_ORDER_UNITPERSON = "unitperson";
    public static final String API_ORDER_UNITSQUARE = "unitsquare";

}
